//
//  XiaoKaiUserSecondCollectionView.m
//  Project_A
//
//  Created by 凯 on 15/7/21.
//  Copyright (c) 2015年 zhoukaidong. All rights reserved.
//

#import "XiaoKaiUserSecondCollectionView.h"
#import "DataBase.h"

@implementation XiaoKaiUserSecondCollectionView

- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
{
    self = [super initWithFrame:frame collectionViewLayout:layout];
    if (self) {
        self.delegate = self;
        self.dataSource = self;
        [self registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"usersecondcollectionviewcell"];
    }
    return self;
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    DataBase *dbManger = [DataBase shareInstance];
    [dbManger openDB];
    self.arr = [dbManger selectItemsInfo];
//    NSLog(@"大哥在这呢%@", self.arr);
    return self.arr.count;
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    
    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"usersecondcollectionviewcell" forIndexPath:indexPath];

    return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
